<?php

namespace App\Http\Controllers\Api;

use App\Http\Resources\EventRecordResource;
use App\Models\EventRecord;
use App\Http\Controllers\Controller;
use App\Http\Requests\Api\EventRecordRequest;

class EventRecordController extends Controller
{
    public function store(EventRecordRequest $request, EventRecord $eventRecord)
    {
        $user = $request->user();
        $eventRecord->fill($request->all());
        $eventRecord->user_id = $user->id;
        $eventRecord->save();
        return $this->resource(new EventRecordResource($eventRecord));
    }
}
